Skip to content

Feat/ai-groq-summarize#837

Open
harshlocham wants to merge 4 commits into
TanStack:mainfrom
harshlocham:feat/ai-groq-summarize
Open

Feat/ai-groq-summarize#837
harshlocham wants to merge 4 commits into
TanStack:mainfrom
harshlocham:feat/ai-groq-summarize

Conversation

@harshlocham

@harshlocham harshlocham commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Replaced the command for the documentation verification script in package.json from node to tsx for improved execution. This change aligns with recent updates to enhance script performance and compatibility.

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • New Features
    • Added Groq summarization adapters (groqSummarize, createGroqSummarize) for @tanstack/ai, including README and adapter documentation updates.
    • Enabled Groq for summarize and summarize-stream in end-to-end support, including /api/summarize.
  • Bug Fixes
    • Fixed maxLength handling to use Groq’s native token limit option.
  • Tests
    • Added unit and end-to-end coverage for Groq adapter creation (env + explicit API key) and option passing.
  • Chores
    • Updated the docs link checker to run the TypeScript verifier via tsx.

- Added `groqSummarize` and `createGroqSummarize` functions for summarization capabilities.
- Updated `package.json` to use `tsx` for running the documentation verification script.
- Enhanced documentation for the Groq adapter to include summarization examples and usage.
- Updated tests to validate the new summarization functionality and ensure proper integration with existing features.
- Modified configuration files to reflect the addition of summarization support.

This commit enhances the Groq integration by providing tree-shakeable summarization adapters, aligning with patterns used by other providers.
Replaced the command for the documentation verification script in package.json from `node` to `tsx` for improved execution. This change aligns with recent updates to enhance script performance and compatibility.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5149d531-4c3a-470d-96e7-89aafa97c2c3

📥 Commits

Reviewing files that changed from the base of the PR and between 96f3afd and 84fc252.

📒 Files selected for processing (1)
  • testing/e2e/src/routes/api.summarize.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • testing/e2e/src/routes/api.summarize.ts

📝 Walkthrough

Walkthrough

Adds Groq summarize factories and exports, wires Groq into summarize tests and e2e routing, and updates docs, navigation metadata, and release notes.

Changes

Groq summarize support

Layer / File(s) Summary
Adapter types and factories
packages/ai-groq/src/adapters/summarize.ts, packages/ai-groq/src/index.ts
GroqSummarizeConfig and GroqSummarizeModel are added, along with createGroqSummarize and groqSummarize exports.
Adapter tests and wrapper behavior
packages/ai-groq/tests/groq-adapter.test.ts, packages/ai/tests/summarize-max-length.test.ts
Groq adapter creation tests and maxLength mapping tests are added for the summarize wrapper.
Summarize route wiring
testing/e2e/src/lib/feature-support.ts, testing/e2e/src/routes/api.summarize.ts
Groq is added to summarize and summarize-stream feature support and to the e2e route factory map.
Docs and release metadata
.changeset/groq-summarize-adapter.md, docs/adapters/groq.md, docs/config.json, package.json, packages/ai-groq/README.md
Groq summarize docs, README features, navigation metadata, docs verification, and the release note are updated.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Suggested reviewers: AlemTuzlak

Sequence Diagram(s)

sequenceDiagram
  participant ApiSummarizeRoute
  participant CreateSummarizeAdapter
  participant createGroqSummarize
  participant GroqTextAdapter
  ApiSummarizeRoute->>CreateSummarizeAdapter: select groq factory
  CreateSummarizeAdapter->>createGroqSummarize: model, apiKey, baseURL, headers
  createGroqSummarize->>GroqTextAdapter: create summarize adapter
  GroqTextAdapter-->>CreateSummarizeAdapter: ChatStreamSummarizeAdapter
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description focuses on the package.json tsx script change and omits the actual Groq summarize feature work. Rewrite the Changes section to summarize the Groq summarize adapter, docs, tests, and release impact; keep the checklist accurate.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately points to the main change: Groq summarize support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/config.json`:
- Around line 443-444: The Groq entry’s metadata is stale: update the updatedAt
value in docs/config.json for the affected entry from the older date to the
current docs change date. Use the existing entry fields around addedAt/updatedAt
to locate the record, and keep the updatedAt timestamp aligned with the content
change while leaving the rest of the metadata unchanged.

In `@testing/e2e/src/routes/api.summarize.ts`:
- Around line 50-54: The Groq e2e setup is overriding the adapter’s default
endpoint and missing the required /openai/v1 path, so requests are going to the
wrong route. Update the groq configuration in api.summarize.ts so
createGroqSummarize still uses llmockBase(aimockPort) but with the Groq-specific
/openai/v1 suffix, ensuring the adapter targets /openai/v1/chat/completions
instead of the root /chat/completions path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 93c8d147-485d-41d5-806c-278babe3ce70

📥 Commits

Reviewing files that changed from the base of the PR and between 037e15a and b8cea00.

📒 Files selected for processing (11)
  • .changeset/groq-summarize-adapter.md
  • docs/adapters/groq.md
  • docs/config.json
  • package.json
  • packages/ai-groq/README.md
  • packages/ai-groq/src/adapters/summarize.ts
  • packages/ai-groq/src/index.ts
  • packages/ai-groq/tests/groq-adapter.test.ts
  • packages/ai/tests/summarize-max-length.test.ts
  • testing/e2e/src/lib/feature-support.ts
  • testing/e2e/src/routes/api.summarize.ts

Comment thread docs/config.json Outdated
Comment thread testing/e2e/src/routes/api.summarize.ts
@harshlocham

Copy link
Copy Markdown
Contributor Author

Updated this PR with the review feedback, merged the latest main, resolved conflicts, and verified everything with pnpm run test:pr. Ready for another look. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant